<script setup lang="ts">

import { Form } from '@/components/Form'
import { useForm } from '@/hooks/web/useForm'
import { PropType, reactive, watch } from 'vue'
import { FormSchema } from '@/types/form'
import { ElButton} from 'element-plus'
import { getCourseTree} from '@/api/course'
const props = defineProps({
  currentRow:{
        default: () => null
  },
  formSchema:{
      type: Array as PropType<FormSchema[]>,
      default: () => null
  }
})

const { register, methods, elFormRef } = useForm({
  schema: props.formSchema
})
    console.log(props.currentRow)
watch(
  () => props.currentRow,
  (currentRow) => {
    if (!currentRow) return
    const { setValues } = methods
    setValues(currentRow)
  },
  {
    deep: true,
    immediate: true
  }
)
</script>
<template>
  <Form  @register="register" >
     <template #url-default>
        <ElButton type="primary" >上传图片</ElButton>
    </template>
  </Form>
</template>
<style scoped>

</style>
